import request from '@/utils/request'

const pmsApi = {
  list: '/boss/system/pms/listAll',
  add: '/boss/system/pms/add',
  remove: '/boss/system/pms/delete',
  update: '/boss/system/pms/update',
  // 项目权限
  listByPro: '/boss/pro/pms/listAll',
  addByPro: '/boss/pro/pms/add',
  removeByPro: '/boss/pro/pms/delete',
  updateByPro: '/boss/pro/pms/update'
}

export function permissionList (parameter) {
    return request({
      url: pmsApi.list,
      method: 'get',
      params: parameter
    })
  }
  export function addPermission (parameter) {
    return request({
      url: pmsApi.add,
      method: 'post',
      data: parameter
    })
  }

  export function updatePermission (parameter) {
    return request({
      url: pmsApi.update,
      method: 'post',
      data: parameter
    })
  }

  export function removePermission (parameter) {
    return request({
      url: pmsApi.remove,
      method: 'post',
      data: parameter
    })
  }

  export function permissionListByPro (parameter) {
    return request({
      url: pmsApi.listByPro,
      method: 'get',
      params: parameter
    })
  }
  export function addPermissionByPro (parameter) {
    return request({
      url: pmsApi.addByPro,
      method: 'post',
      data: parameter
    })
  }

  export function updatePermissionByPro (parameter) {
    return request({
      url: pmsApi.updateByPro,
      method: 'post',
      data: parameter
    })
  }

  export function removePermissionByPro (parameter) {
    return request({
      url: pmsApi.removeByPro,
      method: 'post',
      data: parameter
    })
  }
